package com.istart.aop.dynamicproxy;

import java.lang.reflect.Proxy;

import com.istart.aop.model.Business;
import com.istart.aop.model.IBusiness;
import com.istart.aop.model.IBusiness2;

public class Client {
	
	public static void main(String[] args) {
		Class[] proxyInterface = new Class[]{IBusiness.class,IBusiness2.class};
		LogInvocationHandler handler = new LogInvocationHandler(new Business());
		//生成代理类的类加载器
		ClassLoader classLoader = Client.class.getClassLoader();
		IBusiness2 proxyBusiness = (IBusiness2) Proxy.newProxyInstance(classLoader, proxyInterface, handler);
		proxyBusiness.doSomeThing2();
		
	}
}
